package com.zxy.controller;


import com.zxy.dao.UserMapper;
import com.zxy.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author zxy
 * @since 2022-03-11
 */
@Controller
@RequestMapping("//user")
@Api(tags = "用户管理")
public class UserController {

    @Resource
    private UserMapper userMapper;

    @ApiOperation("查询所有用户信息")
    @RequestMapping("getAll")
    @ResponseBody
    public List<User> getAll(){

        List<User> users = userMapper.selectByMap(new HashMap<>());
        return users;

    }
}
